<?php
session_start();
set_include_path(get_include_path() . PATH_SEPARATOR . '.' . PATH_SEPARATOR . './libs/');
require_once('./libs/classes/articleModel.class.php');
require_once('./libs/Smarty/Smarty.class.php');
$ls = new Smarty();
if(!get_magic_quotes_gpc())
{
	foreach($_POST as $k=>$a)
	{
		$a = addslashes($a);
	}
}
//转换空格换行
$temp = preg_replace('/ /','&nbsp',$_POST['content']);
$temp =  preg_replace('/\n/','<br />',$temp);
$arr = array('article_uid'=>$_SESSION['userinfo']['id'],
					'article_title'=>$_POST['title'],
					'article_content'=>$temp,
					'article_tag'=>$_POST['tags'],
					);
$doit = new Articleop();
if($doit->writeA($arr))
{
	echo "OK";
	echo '<meta http-equiv="refresh" content="2;url=./blogindex.php">';
}
?>